package cn.com.scitc.soft2101.servlet.paid;

import cn.com.scitc.soft2101.dao.PaidTypeDao;
import cn.com.scitc.soft2101.model.Paidtypes;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

// 页面：新增
@WebServlet(urlPatterns = "/paid/new")
public class PaidNewServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        PaidTypeDao paidTypeDao = new PaidTypeDao();
        List<Paidtypes> paidTypes = paidTypeDao.findAll();
        req.setAttribute("paidTypes", paidTypes);
        req.getRequestDispatcher("/WEB-INF/paid/new.jsp").forward(req, resp);
    }
}
